<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>go-pprof | Abel&#39;Blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="pprofpprof is a tool for visualization and analysis of profiling data. pprof reads a collection of profiling samples in profile.proto format andgenerates reports to visualize and help analyze the data">
<meta property="og:type" content="article">
<meta property="og:title" content="go-pprof">
<meta property="og:url" content="http://example.com/2021/06/09/2021/2021-06-09-pprof-doc/index.html">
<meta property="og:site_name" content="Abel&#39;Blog">
<meta property="og:description" content="pprofpprof is a tool for visualization and analysis of profiling data. pprof reads a collection of profiling samples in profile.proto format andgenerates reports to visualize and help analyze the data">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://example.com/2021/06/09/2021/2021-06-09-pprof-doc/images/callgraph.png">
<meta property="article:published_time" content="2021-06-08T16:00:00.000Z">
<meta property="article:modified_time" content="2021-07-28T09:15:28.109Z">
<meta property="article:author" content="Abel Sean">
<meta property="article:tag" content="Server">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/2021/06/09/2021/2021-06-09-pprof-doc/images/callgraph.png">
  
    <link rel="alternate" href="/atom.xml" title="Abel&#39;Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 5.4.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Abel&#39;Blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://example.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-2021/2021-06-09-pprof-doc" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2021/06/09/2021/2021-06-09-pprof-doc/" class="article-date">
  <time datetime="2021-06-08T16:00:00.000Z" itemprop="datePublished">2021-06-09</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      go-pprof
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h1 id="pprof"><a href="#pprof" class="headerlink" title="pprof"></a>pprof</h1><p>pprof is a tool for visualization and analysis of profiling data.</p>
<p>pprof reads a collection of profiling samples in profile.proto format and<br>generates reports to visualize and help analyze the data. It can generate both<br>text and graphical reports (through the use of the dot visualization package).</p>
<p>profile.proto is a protocol buffer that describes a set of callstacks<br>and symbolization information. A common usage is to represent a set of<br>sampled callstacks from statistical profiling. The format is<br>described on the proto/profile.proto file. For details on protocol<br>buffers, see <a target="_blank" rel="noopener" href="https://developers.google.com/protocol-buffers">https://developers.google.com/protocol-buffers</a></p>
<p>Profiles can be read from a local file, or over http. Multiple<br>profiles of the same type can be aggregated or compared.</p>
<p>If the profile samples contain machine addresses, pprof can symbolize<br>them through the use of the native binutils tools (addr2line and nm).</p>
<h1 id="pprof-profiles"><a href="#pprof-profiles" class="headerlink" title="pprof profiles"></a>pprof profiles</h1><p>pprof operates on data in the profile.proto format. Each profile is a collection<br>of samples, where each sample is associated to a point in a location hierarchy,<br>one or more numeric values, and a set of labels. Often these profiles represents<br>data collected through statistical sampling of a program, so each sample<br>describes a program call stack and a number or value of samples collected at a<br>location. pprof is agnostic to the profile semantics, so other uses are<br>possible. The interpretation of the reports generated by pprof depends on the<br>semantics defined by the source of the profile.</p>
<h1 id="Usage-Modes"><a href="#Usage-Modes" class="headerlink" title="Usage Modes"></a>Usage Modes</h1><p>There are few different ways of using <code>pprof</code>.</p>
<h2 id="Report-generation"><a href="#Report-generation" class="headerlink" title="Report generation"></a>Report generation</h2><p>If a report format is requested on the command line:</p>
<pre><code>pprof &lt;format&gt; [options] source
</code></pre>
<p>pprof will generate a report in the specified format and exit.<br>Formats can be either text, or graphical. See below for details about<br>supported formats, options, and sources.</p>
<h2 id="Interactive-terminal-use"><a href="#Interactive-terminal-use" class="headerlink" title="Interactive terminal use"></a>Interactive terminal use</h2><p>Without a format specifier:</p>
<pre><code>pprof [options] source
</code></pre>
<p>pprof will start an interactive shell in which the user can type<br>commands.  Type <code>help</code> to get online help.</p>
<h2 id="Web-interface"><a href="#Web-interface" class="headerlink" title="Web interface"></a>Web interface</h2><p>If a host:port is specified on the command line:</p>
<pre><code>pprof -http=[host]:[port] [options] source
</code></pre>
<p>pprof will start serving HTTP requests on the specified port.  Visit<br>the HTTP url corresponding to the port (typically <code>http://&lt;host&gt;:&lt;port&gt;/</code>)<br>in a browser to see the interface.</p>
<h1 id="Details"><a href="#Details" class="headerlink" title="Details"></a>Details</h1><p>The objective of pprof is to generate a report for a profile. The report is<br>generated from a location hierarchy, which is reconstructed from the profile<br>samples. Each location contains two values: </p>
<ul>
<li><em>flat</em>: the value of the location itself.</li>
<li><em>cum</em>: the value of the location plus all its descendants. </li>
</ul>
<p>Samples that include a location multiple times (e.g. for recursive functions)<br>are counted only once per location.</p>
<h2 id="Options"><a href="#Options" class="headerlink" title="Options"></a>Options</h2><p><em>options</em> configure the contents of a report. Each option has a value,<br>which can be boolean, numeric, or strings. While only one format can<br>be specified, most options can be selected independently of each<br>other.</p>
<p>Some common pprof options are:</p>
<ul>
<li><strong>-flat</strong> [default], <strong>-cum</strong>: Sort entries based on their flat or cumulative<br>value respectively, on text reports.</li>
<li><strong>-functions</strong> [default], <strong>-filefunctions</strong>, <strong>-files</strong>, <strong>-lines</strong>,<br><strong>-addresses</strong>: Generate the report using the specified granularity.</li>
<li><strong>-noinlines</strong>: Attribute inlined functions to their first out-of-line caller.<br>For example, a command like <code>pprof -list foo -noinlines profile.pb.gz</code> can be<br>used to produce the annotated source listing attributing the metrics in the<br>inlined functions to the out-of-line calling line.</li>
<li><strong>-nodecount= <em>int</em>:</strong> Maximum number of entries in the report. pprof will<br>only print this many entries and will use heuristics to select which entries<br>to trim.</li>
<li><strong>-focus= <em>regex</em>:</strong> Only include samples that include a report entry matching<br><em>regex</em>.</li>
<li><strong>-ignore= <em>regex</em>:</strong> Do not include samples that include a report entry<br>matching <em>regex</em>.</li>
<li><strong>-show_from= <em>regex</em>:</strong> Do not show entries above the first one that<br>matches <em>regex</em>.</li>
<li><strong>-show= <em>regex</em>:</strong> Only show entries that match <em>regex</em>.</li>
<li><strong>-hide= <em>regex</em>:</strong> Do not show entries that match <em>regex</em>.</li>
</ul>
<p>Each sample in a profile may include multiple values, representing different<br>entities associated to the sample. pprof reports include a single sample value,<br>which by convention is the last one specified in the report. The <code>sample_index=</code><br>option selects which value to use, and can be set to a number (from 0 to the<br>number of values - 1) or the name of the sample value.</p>
<p>Sample values are numeric values associated to a unit. If pprof can recognize<br>these units, it will attempt to scale the values to a suitable unit for<br>visualization. The <code>unit=</code> option will force the use of a specific unit. For<br>example, <code>unit=sec</code> will force any time values to be reported in<br>seconds. pprof recognizes most common time and memory size units.</p>
<h2 id="Tag-filtering"><a href="#Tag-filtering" class="headerlink" title="Tag filtering"></a>Tag filtering</h2><p>Samples in a profile may have tags. These tags have a name and a value; this<br>value can be either numeric or a string. pprof can select samples from a<br>profile based on these tags using the <code>-tagfocus</code> and <code>-tagignore</code> options.</p>
<p>Generally, these options work as follows:</p>
<ul>
<li><strong>-tagfocus=<em>regex</em></strong> or <strong>-tagfocus=<em>range</em>:</strong> Restrict to samples with tags<br>matched by regexp or in range.</li>
<li><strong>-tagignore=<em>regex</em></strong> or <strong>-tagignore=<em>range</em>:</strong> Discard samples with tags<br>matched by regexp or in range.</li>
</ul>
<p>When using <code>-tagfocus=regex</code> and <code>-tagignore=regex</code>, the regex will be compared<br>to each value associated with each tag. If one specifies a value<br>like <code>regex1,regex2</code>, then only samples with a tag value matching <code>regex1</code><br>and a tag value matching <code>regex2</code> will be kept.</p>
<p>In addition to being able to filter on tag values, one can specify the name of<br>the tag which a certain value must be associated with using the notation<br><code>-tagfocus=tagName=value</code>. Here, the <code>tagName</code> must match the tag’s name<br>exactly, and the value can be either a regex or a range. If one specifies<br>a value like <code>regex1,regex2</code>, then samples with a tag value (paired with the<br>specified tag name) matching either <code>regex1</code> or matching <code>regex2</code> will match.</p>
<p>Here are examples explaining how <code>tagfocus</code> can be used:</p>
<ul>
<li><code>-tagfocus 128kb:512kb</code> accepts a sample iff it has any numeric tag with<br>memory value in the specified range.</li>
<li><code>-tagfocus mytag=128kb:512kb</code> accepts a sample iff it has a numeric tag<br><code>mytag</code> with memory value in the specified range. There isn’t a way to say<br> <code>-tagfocus mytag=128kb:512kb,16kb:32kb</code><br> or <code>-tagfocus mytag=128kb:512kb,mytag2=128kb:512kb</code>. Just single value or<br> range for numeric tags.</li>
<li><code>-tagfocus someregex</code> accepts a sample iff it has any string tag with<br><code>tagName:tagValue</code> string matching specified regexp. In the future, this<br>will change to accept sample iff it has any string tag with <code>tagValue</code> string<br>matching specified regexp.</li>
<li><code>-tagfocus mytag=myvalue1,myvalue2</code> matches if either of the two tag values<br>are present.</li>
</ul>
<p><code>-tagignore</code> works similarly, except that it discards matching samples, instead<br>of keeping them.</p>
<p>If both the <code>-tagignore</code> and <code>-tagfocus</code> expressions (either a regexp or a<br>range) match a given sample, then the sample will be discarded.</p>
<h2 id="Text-reports"><a href="#Text-reports" class="headerlink" title="Text reports"></a>Text reports</h2><p>pprof text reports show the location hierarchy in text format.</p>
<ul>
<li><strong>-text:</strong> Prints the location entries, one per line, including the flat and<br>cum values.</li>
<li><strong>-tree:</strong> Prints each location entry with its predecessors and successors.</li>
<li><strong>-peek= <em>regex</em>:</strong> Print the location entry with all its predecessors and<br>successors, without trimming any entries.</li>
<li><strong>-traces:</strong> Prints each sample with a location per line.</li>
</ul>
<h2 id="Graphical-reports"><a href="#Graphical-reports" class="headerlink" title="Graphical reports"></a>Graphical reports</h2><p>pprof can generate graphical reports on the DOT format, and convert them to<br>multiple formats using the graphviz package.</p>
<p>These reports represent the location hierarchy as a graph, with a report entry<br>represented as a node. Nodes are removed using heuristics to limit the size of<br>the graph, controlled by the <em>nodecount</em> option.</p>
<ul>
<li><strong>-dot:</strong> Generates a report in .dot format. All other formats are generated<br>from this one.</li>
<li><strong>-svg:</strong> Generates a report in SVG format.</li>
<li><strong>-web:</strong> Generates a report in SVG format on a temp file, and starts a web<br>browser to view it.</li>
<li><strong>-png, -jpg, -gif, -pdf:</strong> Generates a report in these formats.</li>
</ul>
<h3 id="Interpreting-the-Callgraph"><a href="#Interpreting-the-Callgraph" class="headerlink" title="Interpreting the Callgraph"></a>Interpreting the Callgraph</h3><ul>
<li><p><strong>Node Color</strong>:</p>
<ul>
<li>large positive cum values are red.（较大的正值为红色。）</li>
<li>large negative cum values are green.（较大的负值为绿色。）</li>
<li>cum values close to zero are grey.（接近零的累积值为灰色。）</li>
</ul>
</li>
<li><p><strong>Node Font Size</strong>:</p>
<ul>
<li>larger font size means larger absolute flat values.（较大的字体大小意味着较大的绝对单位值。）</li>
<li>smaller font size means smaller absolute flat values. （较小的字体大小意味着较小的绝对单位值。）</li>
</ul>
</li>
<li><p><strong>Edge Weight</strong>:</p>
<ul>
<li>thicker edges indicate more resources were used along that path.（较厚的边缘表明沿该路径使用了更多的资源。）</li>
<li>thinner edges indicate fewer resources were used along that path.（较薄的边缘表明沿该路径使用的资源较少。）</li>
</ul>
</li>
<li><p><strong>Edge Color</strong>:</p>
<ul>
<li>large positive values are red.</li>
<li>large negative values are green.</li>
<li>values close to zero are grey.</li>
</ul>
</li>
<li><p><strong>Dashed Edges</strong>（虚线）: some locations between the two connected locations were<br>removed.（两个连接位置之间的某些位置已被删除。）</p>
</li>
<li><p><strong>Solid Edges</strong>（实线）: one location directly calls the other.（一个位置直接调用另一个位置。）</p>
</li>
<li><p><strong>“(inline)” Edge Marker</strong>（带横线标记的线）: the call has been inlined into the caller.（调用者已内联到被调用者）</p>
</li>
</ul>
<p>Let’s consider the following example graph:</p>
<p><img src="images/callgraph.png" alt="callgraph"></p>
<ul>
<li><p>For nodes:</p>
<ul>
<li><code>(*Rand).Read</code> has a small flat value and a small cum value because the<br>the font is small and the node is grey.</li>
<li><code>(*compressor).deflate</code> has a large flat value and a large cum value because the font<br>is large and the node is red.</li>
<li><code>(*Writer).Flush</code> has a small flat value and a large cum value because the font is<br>small and the node is red.</li>
</ul>
</li>
<li><p>For edges:</p>
<ul>
<li>the edge between <code>(*Writer).Write</code> and <code>(*compressor).write</code>: <ul>
<li>Since it is a dashed edge, some nodes were removed between those two.</li>
<li>Since it is thick and red, more resources were used in call stacks between<br>those two nodes.</li>
</ul>
</li>
<li>the edge between <code>(*Rand).Read</code> and <code>read</code>:<ul>
<li>Since it is a dashed edge, some nodes were removed between those two.</li>
<li>Since it is thin and grey, fewer resources were used in call stacks<br>between those two nodes.</li>
</ul>
</li>
<li>the edge between <code>read</code> and <code>(*rngSource).Int63</code>:<ul>
<li>Since it is a solid edge, there are no nodes between those two (i.e. it<br>was a direct call).</li>
<li>Since it is thin and grey, fewer resources were used in call stacks<br>between those two nodes.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="Annotated-code"><a href="#Annotated-code" class="headerlink" title="Annotated code"></a>Annotated code</h2><p>pprof can also generate reports of annotated source with samples associated to<br>them. For these, the source or binaries must be locally available, and the<br>profile must contain data with the appropriate level of detail.</p>
<p>pprof will look for source files on its current working directory and all its<br>ancestors. pprof will look for binaries on the directories specified in the<br><code>$PPROF_BINARY_PATH</code> environment variable, by default <code>$HOME/pprof/binaries</code><br>(<code>%USERPROFILE%\pprof\binaries</code> on Windows). It will look binaries up by name,<br>and if the profile includes linker build ids, it will also search for them in<br>a directory named as the build id.</p>
<p>pprof uses the binutils tools to examine and disassemble the binaries. By<br>default it will search for those tools in the current path, but it can also<br>search for them in a directory pointed to by the environment variable<br><code>$PPROF_TOOLS</code>.</p>
<ul>
<li><strong>-list= <em>regex</em>:</strong> Generates an annotated source listing for functions<br>matching <em>regex</em>, with flat/cum values for each source line.</li>
<li><strong>-disasm= <em>regex</em>:</strong> Generates an annotated disassembly listing for<br>functions matching <em>regex</em>.</li>
<li><strong>-weblist= <em>regex</em>:</strong> Generates a source/assembly combined annotated listing<br>for functions matching <em>regex</em>, and starts a web browser to display it.</li>
</ul>
<h2 id="Comparing-profiles"><a href="#Comparing-profiles" class="headerlink" title="Comparing profiles"></a>Comparing profiles</h2><p>pprof can subtract one profile from another, provided the profiles are of<br>compatible types (i.e. two heap profiles). pprof has two options which can be<br>used to specify the filename or URL for a profile to be subtracted from the<br>source profile:</p>
<ul>
<li><p><strong>-diff_base= <em>profile</em>:</strong> useful for comparing two profiles. Percentages in<br>the output are relative to the total of samples in the diff base profile.</p>
</li>
<li><p><strong>-base= <em>profile</em>:</strong> useful for subtracting a cumulative profile, like a<br><a target="_blank" rel="noopener" href="https://golang.org/doc/diagnostics.html#profiling">golang block profile</a>,<br>from another cumulative profile collected from the same program at a later time.<br>When comparing cumulative profiles collected on the same program, percentages in<br>the output are relative to the difference between the total for the source<br>profile and the total for the base profile.</p>
</li>
</ul>
<p>The <strong>-normalize</strong> flag can be used when a base profile is specified with either<br>the <code>-diff_base</code> or the <code>-base</code> option. This flag scales the source profile so<br>that the total of samples in the source profile is equal to the total of samples<br>in the base profile prior to subtracting the base profile from the source<br>profile. Useful for determining the relative differences between profiles, for<br>example, which profile has a larger percentage of CPU time used in a particular<br>function.</p>
<p>When using the <strong>-diff_base</strong> option, some report entries may have negative<br>values. If the merged profile is output as a protocol buffer, all samples in the<br>diff base profile will have a label with the key “pprof::base” and a value of<br>“true”. If pprof is then used to look at the merged profile, it will behave as<br>if separate source and base profiles were passed in.</p>
<p>When using the <strong>-base</strong> option to subtract one cumulative profile from another<br>collected on the same program at a later time, percentages will be relative to<br>the difference between the total for the source profile and the total for<br>the base profile, and all values will be positive. In the general case, some<br>report entries may have negative values and percentages will be relative to the<br>total of the absolute value of all samples when aggregated at the address level.</p>
<h1 id="Fetching-profiles"><a href="#Fetching-profiles" class="headerlink" title="Fetching profiles"></a>Fetching profiles</h1><p>pprof can read profiles from a file or directly from a URL over http or https.<br>Its native format is a gzipped profile.proto file, but it can<br>also accept some legacy formats generated by<br><a target="_blank" rel="noopener" href="https://github.com/gperftools/gperftools">gperftools</a>.</p>
<p>When fetching from a URL handler, pprof accepts options to indicate how much to<br>wait for the profile.</p>
<ul>
<li><strong>-seconds= <em>int</em>:</strong> Makes pprof request for a profile with the specified<br>duration in seconds. Only makes sense for profiles based on elapsed time, such<br>as CPU profiles.</li>
<li><strong>-timeout= <em>int</em>:</strong> Makes pprof wait for the specified timeout when<br>retrieving a profile over http. If not specified, pprof will use heuristics to<br>determine a reasonable timeout.</li>
</ul>
<p>pprof also accepts options which allow a user to specify TLS certificates to<br>use when fetching or symbolizing a profile from a protected endpoint. For more<br>information about generating these certificates, see<br><a target="_blank" rel="noopener" href="https://docs.docker.com/engine/security/https/">https://docs.docker.com/engine/security/https/</a>.</p>
<ul>
<li><strong>-tls_cert= <em>/path/to/cert</em>:</strong> File containing the TLS client certificate<br>to be used when fetching and symbolizing profiles.</li>
<li><strong>-tls_key= <em>/path/to/key</em>:</strong> File containing the TLS private key to be used<br>when fetching and symbolizing profiles.</li>
<li><strong>-tls_ca= <em>/path/to/ca</em>:</strong> File containing the certificate authority to be<br>used when fetching and symbolizing profiles.</li>
</ul>
<p>pprof also supports skipping verification of the server’s certificate chain and<br>host name when collecting or symbolizing a profile. To skip this verification,<br>use “https+insecure” in place of “https” in the URL.</p>
<p>If multiple profiles are specified, pprof will fetch them all and merge<br>them. This is useful to combine profiles from multiple processes of a<br>distributed job. The profiles may be from different programs but must be<br>compatible (for example, CPU profiles cannot be combined with heap profiles).</p>
<h2 id="Symbolization"><a href="#Symbolization" class="headerlink" title="Symbolization"></a>Symbolization</h2><p>pprof can add symbol information to a profile that was collected only with<br>address information. This is useful for profiles for compiled languages, where<br>it may not be easy or even possible for the profile source to include function<br>names or source coordinates.</p>
<p>pprof can extract the symbol information locally by examining the binaries using<br>the binutils tools, or it can ask running jobs that provide a symbolization<br>interface.</p>
<p>pprof will attempt symbolizing profiles by default, and its <code>-symbolize</code> option<br>provides some control over symbolization:</p>
<ul>
<li><p><strong>-symbolize=none:</strong> Disables any symbolization from pprof.</p>
</li>
<li><p><strong>-symbolize=local:</strong> Only attempts symbolizing the profile from local<br>binaries using the binutils tools.</p>
</li>
<li><p><strong>-symbolize=remote:</strong> Only attempts to symbolize running jobs by contacting<br>their symbolization handler.</p>
</li>
</ul>
<p>For local symbolization, pprof will look for the binaries on the paths specified<br>by the profile, and then it will search for them on the path specified by the<br>environment variable <code>$PPROF_BINARY_PATH</code>. Also, the name of the main binary can<br>be passed directly to pprof as its first parameter, to override the name or<br>location of the main binary of the profile, like this:</p>
<pre><code>pprof /path/to/binary profile.pb.gz
</code></pre>
<p>By default pprof will attempt to demangle and simplify C++ names, to provide<br>readable names for C++ symbols. It will aggressively discard template and<br>function parameters. This can be controlled with the <code>-symbolize=demangle</code><br>option. Note that for remote symbolization mangled names may not be provided by<br>the symbolization handler.</p>
<ul>
<li><p><strong>-symbolize=demangle=none:</strong> Do not perform any demangling. Show mangled<br>names if available.</p>
</li>
<li><p><strong>-symbolize=demangle=full:</strong> Demangle, but do not perform any<br>simplification. Show full demangled names if available.</p>
</li>
<li><p><strong>-symbolize=demangle=templates:</strong> Demangle, and trim function parameters, but<br>not template parameters.</p>
</li>
</ul>
<h1 id="Web-Interface"><a href="#Web-Interface" class="headerlink" title="Web Interface"></a>Web Interface</h1><p>When the user requests a web interface (by supplying an <code>-http=[host]:[port]</code><br>argument on the command-line), pprof starts a web server and opens a browser<br>window pointing at that server. The web interface provided by the server allows<br>the user to interactively view profile data in multiple formats.</p>
<p>The top of the display is a header that contains some buttons and menus.</p>
<h2 id="Config"><a href="#Config" class="headerlink" title="Config"></a>Config</h2><p>The <code>Config</code> menu allows the user to save the current refinement<br>settings (e.g., the focus and hide list) as a named configuration. A<br>saved configuration can later be re-applied to reinstitue the saved<br>refinements. The <code>Config</code> menu contains:</p>
<p><strong>Save as …</strong>: shows a dialog where the user can type in a<br>configuration name. The current refinement settings are saved under<br>the specified name.</p>
<p><strong>Default</strong>: switches back to the default view by removing all refinements.</p>
<p>The <code>Config</code> menu also contains an entry per named<br>configuration. Selecting such an entry applies that configuration. The<br>currently selected entry is marked with a ✓. Clicking on the 🗙 on the<br>right-hand side of such an entry deletes the configuration (after<br>prompting the user to confirm).</p>
<h2 id="TODO-cover-the-following-issues"><a href="#TODO-cover-the-following-issues" class="headerlink" title="TODO: cover the following issues:"></a>TODO: cover the following issues:</h2><ul>
<li>  Overall layout</li>
<li>  Menu entries</li>
<li>  Explanation of all the views</li>
</ul>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://example.com/2021/06/09/2021/2021-06-09-pprof-doc/" data-id="ckrn3an7s002m20xweejl00rq" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Server/" rel="tag">Server</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2021/06/21/2021/2021-06-21-server%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          server测试工具
        
      </div>
    </a>
  
  
    <a href="/2021/04/19/2021/2021-04-19-c++-metaprogramming/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">c++metaprogramming</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/3D/" rel="tag">3D</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/AI/" rel="tag">AI</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/C/" rel="tag">C++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Game/" rel="tag">Game</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Go/" rel="tag">Go</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Linux/" rel="tag">Linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Math/" rel="tag">Math</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Server/" rel="tag">Server</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Unreal-Engine4/" rel="tag">Unreal Engine4</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/" rel="tag">git</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/golang/" rel="tag">golang</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/guitar/" rel="tag">guitar</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/node-js/" rel="tag">node.js</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/" rel="tag">protobuf</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/" rel="tag">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/recast/" rel="tag">recast</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/" rel="tag">redis</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/type/" rel="tag">type</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vscode/" rel="tag">vscode</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%BF%90%E7%BB%B4/" rel="tag">运维</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/3D/" style="font-size: 10px;">3D</a> <a href="/tags/AI/" style="font-size: 11.67px;">AI</a> <a href="/tags/C/" style="font-size: 15px;">C++</a> <a href="/tags/Game/" style="font-size: 18.33px;">Game</a> <a href="/tags/Go/" style="font-size: 13.33px;">Go</a> <a href="/tags/Linux/" style="font-size: 13.33px;">Linux</a> <a href="/tags/Math/" style="font-size: 11.67px;">Math</a> <a href="/tags/Server/" style="font-size: 16.67px;">Server</a> <a href="/tags/Unreal-Engine4/" style="font-size: 10px;">Unreal Engine4</a> <a href="/tags/git/" style="font-size: 10px;">git</a> <a href="/tags/golang/" style="font-size: 20px;">golang</a> <a href="/tags/guitar/" style="font-size: 10px;">guitar</a> <a href="/tags/node-js/" style="font-size: 10px;">node.js</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/python/" style="font-size: 10px;">python</a> <a href="/tags/recast/" style="font-size: 11.67px;">recast</a> <a href="/tags/redis/" style="font-size: 10px;">redis</a> <a href="/tags/type/" style="font-size: 10px;">type</a> <a href="/tags/vscode/" style="font-size: 10px;">vscode</a> <a href="/tags/%E8%BF%90%E7%BB%B4/" style="font-size: 16.67px;">运维</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/07/">July 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/06/">June 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/04/">April 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/03/">March 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/01/">January 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/12/">December 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/11/">November 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">November 2018</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2021/07/19/2021/2021-07-19-etcd-learn/">go-etcd阅读笔记</a>
          </li>
        
          <li>
            <a href="/2021/07/19/2021/2021-07-19-socketop-learn/">REUSEPORT-REUSEADDR-学习</a>
          </li>
        
          <li>
            <a href="/2021/06/22/2021/2021-06-22-go-ethereum-learn/">go-ethereum阅读笔记</a>
          </li>
        
          <li>
            <a href="/2021/06/21/2021/2021-06-21-server%E6%B5%8B%E8%AF%95%E5%B7%A5%E5%85%B7/">server测试工具</a>
          </li>
        
          <li>
            <a href="/2021/06/09/2021/2021-06-09-pprof-doc/">go-pprof</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2021 Abel Sean<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




  </div>
</body>
</html>